package main

import "fmt"

func main() {
	fmt.Println("hello world")

	var i int = 1
	for i < 5 {
		fmt.Println(i)
		i++
	}

	var sum = sum(80, 20)
	fmt.Println("sum =", sum)
	f := getSub()
	fmt.Println(f(10))
}

func sum(a int, b int) int {
	return a + b
}

func getSub() func(int) int {
	var n int = 10
	return func(i int) int {
		return n + i
	}
}

func init() {
	f := getSub()
	fmt.Println(f(10))
}
